//
//  MyCollectionViewCell.m
//  电影豆瓣--完整版
//
//  Created by dllo on 16/1/7.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "MyCollectionViewCell.h"

@implementation MyCollectionViewCell



- (void)dealloc {
    [_imagView release];
    [_titleLabel release];
    [super dealloc];
}


- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self create];
    }
    return self;
}

- (void)create {
    self.imagView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.imagView];
    [_imagView release];
    
    self.titleLabel = [[UILabel alloc] init];
    _titleLabel.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:self.titleLabel];
    [_titleLabel release];
 
}


- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes {
    self.imagView.frame = CGRectMake(0, 0, layoutAttributes.frame.size.width, layoutAttributes.frame.size.height - 30);
    self.titleLabel.frame = CGRectMake(0, layoutAttributes.frame.size.height - 30, layoutAttributes.frame.size.width, 30);
    self.imagView.backgroundColor = [UIColor purpleColor];
    self.titleLabel.backgroundColor = [UIColor clearColor];
    
}






@end
